﻿using System.ComponentModel.DataAnnotations;

namespace AiQiuQuan.Sport.Model.Models
{
    /// <summary>
    /// 教练场馆增加
    /// </summary>
    public class CoacherVenueAddDto : IValidatableObject
    {
        /// <summary>
        /// 场馆列表
        /// </summary>
        [Required]
        [MinLength(1)]
        public List<Guid> VenueIdList { get; set; }

        /// <summary>
        /// validate
        /// </summary>
        public IEnumerable<ValidationResult> Validate(ValidationContext validationContext)
        {
            foreach (var item in VenueIdList)
            {
                if (VenueIdList.Count(m => m == item) >= 2)
                {
                    yield return new ValidationResult("场馆重复");
                    yield break;
                }
            }
        }
    }

    /// <summary>
    /// 场馆新增详情
    /// </summary>
    public class CoacherVenueAddDetail
    {
        /// <summary>
        /// 场馆ID
        /// </summary>
        [Required]
        public Guid VenueId { get; set; }

        /// <summary>
        /// 是否主要工作地点
        /// </summary>
        [Required]
        public bool IsMain { get; set; }

        /// <summary>
        /// 是否黑名单
        /// </summary>
        public bool IsBlack { get; set; }

        /// <summary>
        /// 是否推荐
        /// </summary>
        [Required]
        public bool IsRecommend { get; set; }
    }
}
